Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 2 - AppleScript Language Reference
Chapter 3 - Values


Value Class Definitions

This section describes the AppleScript value classes. Table 3-1 summarizes the class identifiers recognized by AppleScript.
AppleScript value class identifiers
Value class identifierDescription of corresponding value
BooleanA logical truth value
ClassA class identifier
ConstantA reserved word defined by an application or AppleScript
DataRaw data that cannot be represented in AppleScript, but can be stored in a variable
DateA string that specifies a day of the week, day of the month, month, year, and time
IntegerA positive or negative number without a fractional part
ListAn ordered collection of values
NumberSynonym for class Integer or class Real; a positive or negative number that can be either of class Integer or of class Real
RealA positive or negative number that can have a fractional part
RecordA collection of properties
ReferenceA reference to an object
StringAn ordered series of characters
Styled TextSynonym for a special string that includes style and font information
TextSynonym for class string

Three identifiers in Table 3-1 act only as synonyms for other value classes: Number is a synonym for either Integer or Real, Text is a synonym for String, and Styled Text is a synonym for a string that contains style and font information. You can coerce values using these synonyms, but the class of the resulting value is always the true value class.

For example, you can use the class identifier Text to coerce a date to a string:

set x to date "May 14, 1993" as text
class of x
--result: string
Although definitions for value class synonyms are included in the sections that follow, they do not correspond to separate value classes. For more information about coercing values using synonyms, see "Coercing Values," which begins on page 66.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996